<?php 
$page_title="Profile";
require_once('../auth/auth.php');
$page_title= $_SESSION['SESS_USER_TITLE'] . " " . $_SESSION['SESS_USER_LAST_NAME'] . "'s Profile";
include('templates/header.php'); 

// Accesses database                                    
 include 'db/db_Connect.php';
 	$user_id = $_SESSION['SESS_USER_ID'];
 	$result = mysql_query("SELECT * from User WHERE user_id = '$user_id'");
	$user = mysql_fetch_array($result);

 include 'db/db_Close.php';    
?>
			<div class="row-fluid sortable">
				<div class="box span12">
					<div class="box-header well" data-original-title>
						<h2><i class="icon-user"></i> Personal Information</h2>
						<div class="box-icon">
							<a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>
							<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
						</div>
					</div>
					<div class="box-content">
					
						<form class="form-horizontal" name="updateProfileForm" action="db/updateProfileInformationDB.php" method="post">
							<fieldset>
							
					<!-- User Title Drop Down Selector-->
						<div class="control-group">
								<label class="control-label" for="selectError3">Title</label>
								<div class="controls">
								  <select name="title">
									<option>Select One</option>
									<option value="Mr." <?php if($user['title'] == 'Mr.'){ echo "selected=''";} ?>>Mr.</option>
									<option value="Mrs." <?php if($user['title'] == 'Mrs.'){ echo "selected=''";} ?>>Mrs.</option>
									<option value="Miss." <?php if($user['title'] == 'Miss.'){ echo "selected=''";} ?>>Miss.</option>
									<option value="Ms." <?php if($user['title'] == 'Ms.'){ echo "selected=''";} ?>>Ms.</option>									
									<option value="Dr." <?php if($user['title'] == 'Dr.'){ echo "selected=''";} ?>>Dr.</option>	
									<option value="Rev." <?php if($user['title'] == 'Rev.'){ echo "selected=''";} ?>>Rev.</option>									
									<option value="Fr." <?php if($user['title'] == 'Fr.'){ echo "selected=''";} ?>>Fr.</option>									
								  </select>
								</div>
							  </div>					
						<!-- First Name-->							
							  <div class="control-group">
									<label class="control-label" for="focusedInput">First Name</label>
								<div class="controls">
								  <input name="first_name" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $user['first_name']; ?>">
								</div>
							  </div>
						<!-- Last Name-->
							  	<div class="control-group">
									<label class="control-label" for="focusedInput">Last Name</label>
								<div class="controls">
								  <input name="last_name" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $user['last_name']; ?>">
								</div>
							  </div>
						<!-- Gender-->				
							  <div class="control-group">
								<label class="control-label">Gender</label>
								<div class="controls">
								  <label class="radio">
									<input name="gender" type="radio" name="gender" id="genderradio1" value="male" <?php if($user['gender'] == 'male'){ echo "checked=''";} ?> >
										Male
								  </label>
								  <div style="clear:both"></div>
								  <label class="radio">
									<input type="radio" name="gender" id="genderradio2" value="female" <?php if($user['gender'] == 'female'){ echo "checked=''";} ?> >
										Female
								  </label>
								</div>
							  </div>
						<!-- Email Address-->							
							  <div class="control-group">
									<label class="control-label" for="focusedInput">Email Address</label>
								<div class="controls">
								  <input name="email_address" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $user['email_address']; ?>">
								</div>
							  </div>	
						<!-- Phone Number -->							
							  <div class="control-group">
									<label class="control-label" for="focusedInput">Phone Number</label>
								<div class="controls">
								  <input name="phone_number" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $user['phone_number']; ?>">
								</div>
							  </div>							  
						<!-- Apartment Number-->							
							  <div class="control-group">
									<label class="control-label" for="focusedInput">Apartment #</label>
								<div class="controls">
								  <input name="apt_number" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $user['apt_number']; ?>">
								</div>
							  </div>	
						<!-- Street Address -->							
							  <div class="control-group">
									<label class="control-label" for="focusedInput">Street Address</label>
								<div class="controls">
								  <input name="street_address" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $user['street_address']; ?>">
								</div>
							  </div>		
						<!-- City -->							
							  <div class="control-group">
									<label class="control-label" for="focusedInput">City</label>
								<div class="controls">
								  <input name="city" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $user['city']; ?>">
								</div>
							  </div>							  
						<!-- State -->							
								<div class="control-group">
								  <label class="control-label" for="typeahead">State</label>
								  <div class="controls">
									<input name="state" type="text" class="span6 typeahead" id="typeahead" value="<?php echo $user['state']; ?>"  data-provide="typeahead" data-items="4" data-source='["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Dakota","North Carolina","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"]'>
								  </div>
								</div>
						<!-- Zipcode -->							
							  <div class="control-group">
									<label class="control-label" for="focusedInput">Zipcode</label>
								<div class="controls">
								  <input name="zipcode" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $user['zipcode']; ?>">
								</div>
							  </div>								  							  						  						  
							  
							  <div class="form-actions">
								<button type="submit" class="btn btn-primary">Save changes</button>
								<button class="btn" type="reset">Cancel</button>
							  </div>
							</fieldset>
						  </form>
					
					</div>
				</div><!--/span-->
			
			</div><!--/row-->
			
						<div class="row-fluid sortable">
				<div class="box span12">
					<div class="box-header well" data-original-title>
						<h2><i class="icon-user"></i> Christmas Program Login Details</h2>
						<div class="box-icon">
							<a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>
							<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
						</div>
					</div>
					<div class="box-content">
					
						<form class="form-horizontal" name="updateProfileForm" action="db/updateLoginInformationDB.php" method="post">
							<fieldset>
													  							  						  
						<!-- Login Screename -->							
							  <div class="control-group">
									<label class="control-label" for="focusedInput">Username</label>
								<div class="controls">
								  <input name="login_id" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $user['login_id']; ?>">
								</div>
							  </div>		
					<!-- Current Password -->							
							  <div class="control-group">
									<label class="control-label" for="focusedInput">Current Password</label>
								<div class="controls">
								  <input name="password" type="password" class="input-xlarge focused" id="focusedInput" type="text" >
								</div>
							  </div>								  					  
					<!-- Change Password -->							
							  <div class="control-group">
									<label class="control-label" for="focusedInput">New Password</label>
								<div class="controls">
								  <input name="new_password_1" type="password" class="input-xlarge focused" id="focusedInput" type="text" >
								</div>
							  </div>	
						<!-- Confirm Changed Password -->							
							  <div class="control-group">
									<label class="control-label" for="focusedInput">Confirm New Password</label>
								<div class="controls">
								  <input name="new_password_2" type="password" class="input-xlarge focused" id="focusedInput" type="text" >
								</div>
							  </div>								  
							  
							  <div class="form-actions">
								<button type="submit" class="btn btn-primary">Save changes</button>
								<button class="btn" type="reset">Cancel</button>
							  </div>
							</fieldset>
						  </form>
					
					</div>
				</div><!--/span-->
			
			</div><!--/row-->
    
<?php include('templates/footer.php'); ?>
